Described below is a technique for handling the restore and archive process on an on-line archive. An on-line archive is a process in which database objects, for example database tables, are archived while allowing the objects to be updated.
It is desirable that a given archive operation within a database system be associated with a single consistency point. A consistency point can be thought of as a certain point in time such that all changes that committed prior to that point, and only those changes, are visible. All “visible” states of a database are consistent. The transition from one consistent state to another may entail multiple update actions but the intermediate states are only visible within the updating transaction. Only the final state becomes visible when the updating transaction terminates successfully. If the updating transaction does not complete successfully then all changes are automatically voided.
Database systems employ various methods to prevent the exposure of transitional states. All such methods are variants of two basic approaches, namely locking and versioning. In a locking system, transactions must request permission from a lock manager to read or update specific data objects. When a lock is granted, it is held by the transaction until it terminates. The lock manager will delay granting a lock while a conflicting lock is held by another transaction. One disadvantage of locking is that transaction delays due to lock conflicts may be excessive under certain conditions.
In a versioning system, multiple versions of an object are maintained. Alternatively, at least information sufficient to reconstruct an earlier version is preserved and linked to the new version. Only one version of the object, which is not necessarily the latest version, is visible to a given transaction. With a versioning system, a transaction is never delayed due to a conflicting update. Instead the transaction is given immediate access to some earlier version of the object. Disadvantages of versioning systems include the fact that they require more storage space to maintain multiple versions of objects, additional information must be maintained for each object so that the system can select the correct version and also determine when a version becomes completely obsolete and available for physical removal, and also queries may incur additional processing overhead to filter out unwanted versions of objects.
The method described here combines elements of the locking and versioning techniques in a novel way.